//- Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. 
//- <https://www.chatopera.com>, Licensed under the Chunsong Public 
//- License, Version 1.0  (the "License"), https://docs.cskefu.com/licenses/v1.html
//- Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//- Copyright (C) 2018-Jun. 2023 Chatopera Inc, <https://www.chatopera.com>
//- Licensed under the Apache License, Version 2.0
//- http://www.apache.org/licenses/LICENSE-2.0
.uk-layui-form
    form.layui-form.uk-form(action='/admin/sysdic/dicitem/save.html')
        input(type='hidden', name='parentid', value=sysDic.id)
        input(type='hidden', name='dicid', value=((sysDic.parentid && sysDic.parentid == 0) ? sysDic.id : sysDic.dicid))
        input(type='hidden', name='p', value=(p ? p : '1'))
        .layui-form-item
            label.layui-form-label 名称：
            .layui-input-inline
                input.layui-input(type='text', name='name', required, lay-verify='required', placeholder='请输入名称', autocomplete='off')
        .layui-form-item
            label.layui-form-label 代码：
            .layui-input-inline
                input.layui-input(type='text', name='code', required, lay-verify='required', placeholder='请输入代码', autocomplete='off')
        .layui-form-item
            label.layui-form-label 图标：
            .layui-input-inline
                input.layui-input(type='text', name='iconstr', placeholder='请输入图标代码', autocomplete='off')
        .layui-form-item
            label.layui-form-label 图标类型：
            .layui-input-inline
                select(name='ctype', lay-verify)
                    option(value='layui-icon') LayUI
                    option(value='kfont') KFont
                    option(value='layout') Layout
                    option(value='report') Report
        .layui-form-item
            label.layui-form-label 颜色：
            .layui-input-inline
                input.layui-input(type='text', name='iconskin', placeholder='请输入颜色', autocomplete='off')
        .layui-form-item
            label.layui-form-label 显示代码：
            .layui-input-inline
                input(type='checkbox', name='discode', lay-skin='switch', lay-text='启用|禁用', value='1')
        .layui-form-item
            label.layui-form-label 说明：
            .layui-input-inline
                textarea.layui-textarea(name='description', placeholder='请输入')
        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit, lay-filter='formDemo') 立即提交
                button.layui-btn.layui-btn-original(type='reset') 重置
script.
    layui.use('form', function () {
        var form = layui.form();
        form.render(); //更新全部
        form.verify({
            repass: function (value) {
                if (value != $('#password').val()) {
                    return '两次输入的密码不一致，请确认';
                }
            }
        });
    });

